// import axios from "axios";

const message = "hello Main";
console.log(message);

const bar = () => {
  console.log("bar");
};

bar();

/* axios
  .get("http://123.207.32.32:9002/lyric?id=1842025914")
  .then((res) => console.log(res.data));
 */

const btn1 = document.createElement("button");
const btn2 = document.createElement("button");
btn1.textContent = "关于";
btn2.textContent = "分类";
document.body.append(btn1);
document.body.append(btn2);

btn1.onclick = async () => {
  const ret = await import(/* webpackChunkName:"about" */ "./router/about");
  console.log(ret);
  ret.bar();
  console.log(ret.default);
};

btn2.onclick = async () => {
  // 魔法注释，为chunkFilename定义name，可以用于webpack中[name]
  await import(/* webpackChunkName:"category" */ "./router/category");
};
